home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / hdtips.arc / HD-TIPS.TXT
Text File  |  1986-01-17  |  17KB  |  400 lines

  1.                           Part I, File Management
  2.  
  3.                                Barry Gordon
  4.                      New York Personal Computer, Inc.
  5.  
  6. This  article is about organizing files on any hard disk attached to  a
  7. member  of the IBM PC family,  including the  PC  with  an Expansion  Unit,
  8. and  certainly,   the  PC  AT.  The  following suggestions have evolved
  9. from several months of using the IBM  PC XT as a follow-on system to the
  10. IBM PC.     I hope these thoughts prove  useful  to those who work with
  11. hard disks on the  IBM  PC, particularly those who are new to it.
  12.  
  13. File Management
  14.  
  15. The  hard  disk is not merely an overgrown diskette.   It can  be used that
  16. way,  but you would be inviting serious file management problems in doing
  17. so.   The hard disk has other capabilities  you should utilize, and there
  18. is no reason not to take full advantage of the hard disk's potential.
  19.  
  20. About the last thing you want to deal with is a ten megabyte hard disk
  21. containing  all its files in one directory.   (There  is  a limit  of how
  22. many files the root directory can contain,  so  the disk  may give you an
  23. error message even though much of the  disk is  not  filled.)  With
  24. intelligent organization,  the hard  disk retains its speed advantage over
  25. the diskette, and you are better able  to keep track of your files as well.
  26. The name of each file should  use filename and the three-letter extension.
  27. Sooner  or later you will need all the help you can get in remembering
  28. what each file contains.  Most importantly,  though, your files should be
  29. organized among several directories.
  30.  
  31. The Root Directory
  32.  
  33. Each  DOS  volume (diskette or hard disk) has  a  root  directory which DOS
  34. creates when it formats the disk. The root directory on your  hard disk
  35. should contain a minimum of files,  reserving the space for sub-directory
  36. names.
  37.  
  38. Nonetheless,  a  few files are essential in the  root  directory. When you
  39. format the hard disk, use the /S parameter:  FORMAT C:/S which copies three
  40. .COM files to your hard disk:
  41.  
  42.                                (IBMBIO.COM)
  43.                                (IBMDOS.COM)
  44.                                 COMMAND.COM
  45.  
  46. Notice that the first two are hidden files.    You won't see them in  any
  47. DIRectory listing,  but the CHKDSK command will tell  you they are there.
  48.  
  49. You  should store the various DOS external command files and  all data
  50. files in other sub-directories.
  51.  
  52. Sub-directories for Executable Files
  53.  
  54. Now  let's  consider  locating your  various  executable  program
  55. files--the .EXE,  .COM,  and .BAT files.  You'll want to separate related
  56. programs into sub-directories of their own.  For example, you may want one
  57. sub-directory containing all of the external DOS commands,  another
  58. sub-directory with your word processing  .COM and .EXE files, another with
  59. your accounting .COM and .EXE files, etc.   until you have stored all of
  60. your executable programs into sub-directories. They are much easier to
  61. remember this way.
  62.  
  63. The  root  directory  has no user-assigned  name,  but  all  sub-
  64. directories  are  specifically created and named using the  MKDIR command,
  65. MD for short:
  66.  
  67.                                 MD anyname
  68.  
  69. You can create as many levels of sub-directories as you like, but
  70. generally,  the fewer levels you have to create, the simpler your directory
  71. structure will be.   There will be times when a second- or  third-level
  72. sub-directory  is needed  (a  directory  created within another
  73. sub-directory),  but multi-leveled sub-directories create a more complex
  74. path structure for both you and DOS to sort through.
  75.  
  76. Directory Sizes
  77.  
  78. You can fill a sub-directory with as many bytes as the disk  will allow,
  79. but it is often convenient to limit the size of those sub- directories
  80. into which you regularly store data to the  capacity of a single diskette,
  81. 320-360 KB.   This allows you to back up a directory using the COPY
  82. command:
  83.  
  84.                                COPY C:*.* A:
  85.  
  86. The  COPYable directory size offers an alternative to the  BACKUP and
  87. RESTORE  commands,  an alternative that many find easier  to use.   It
  88. offers portability as well as backup.  If you want  to verify  the  copy
  89. with its original,  you can  follow  the  COPY command with this:
  90.  
  91.                                 COMP C: A:
  92.  
  93. However,  if  you  feel confident using the  BACKUP  and  RESTORE commands,
  94. the  contents of a single sub-directory can be as many bytes as you like.
  95. The bigger it is, the more time consuming the backup process becomes.
  96.  
  97. Another  suggestion  is  to give each backup  diskette  a  volume label.
  98. This is especially useful if you use the COPY command to back up your
  99. sub-directories.  By using the /V parameter when you format  the diskette,
  100. you can label your diskette with the  same name as the directory it backs
  101. up.
  102.  
  103. It  is  rarely  necessary  to  back  up  the  entire  hard  disk.
  104. Typically,  you  store  data changes in the files of a  few  sub-
  105. directories, those few being the only sub-directories you need to back up
  106. regularly.   Many sub-directories never change,  and need backing up only
  107. once.
  108.  
  109.  
  110.  
  111.  
  112.                          Part II, DOS BATch Files
  113.  
  114.                                Barry Gordon
  115.                      New York Personal Computer, Inc.
  116.  
  117. DOS and BATch Files
  118.  
  119. Familiarity  with DOS is assumed.  However,  it is helpful to the new user
  120. to include a paragraph or two on BATch files.   The  IBM PC  and DOS work
  121. with three different kinds of program or command files:   .EXE, .COM, and
  122. .BAT files.  (BASIC and BASICA work with their own .BAS files,  but those
  123. are not relevant to the  present discussion.)  The .EXE and .COM files give
  124. instructions to the PC itself.  They are produced by assemblers, compilers,
  125. and linkers.  The .BAT or BATch files are instructions to DOS which you
  126. create for  your own convenience.   I will discuss a couple of  commands
  127. that  you  may  find convenient in working on your  PC:  the  DOS PROMPT
  128. command and the PATH command.
  129.  
  130. The DOS PROMPT Command
  131.  
  132. Just  as DOS keeps track of a default disk drive,  it  will  also keep
  133. track of each drive's current directory (the directory  you are working
  134. in).  Most often,  this directory is the one you tell DOS to assume and use
  135. when no other is specified.  The DOS prompt always  has  indicated  the
  136. default disk drive  followed  by  the greater-than symbol:   A>  which
  137. works well for diskette  drives.  With  a  hard disk,  you will want to
  138. know the directory you  are working  in (the current directory) as well.
  139. You can  customize the  prompt  to show the current directory using the
  140. DOS  PROMPT command.   The command PROMPT $P$G tells DOS to display the
  141. name of  the  current  directory whenever the prompt appears  on  your
  142. screen.  Other,  more elaborate,  prompt variations are possible, but  $P$G
  143. is  a useful  beginning.
  144.  
  145. The DOS PATH Command
  146.  
  147. The  actual program fetching is accomplished by means of the  DOS PATH
  148. command.   This  command tells DOS where to look  for  your programs (the
  149. executable files) when they are not in the  current directory.  The overall
  150. scheme begins to take shape:  you work in the (current) directory
  151. containing your data files, and DOS looks for  the programs you need (in
  152. priority sequence) in  other  sub- directories.   Thus,  your PATH command
  153. might look something like this:
  154.  
  155.                    PATH C:\anyname1;C:\anyname2;C:\any3
  156.  
  157. The  PATH  command should contain the full specification of  each
  158. sub-directory,  including the drive designation.   This keeps the search
  159. path valid even if you should decide to make,  say,  drive A:  the default
  160. drive temporarily. Since the root directory is not named,  it is not
  161. included in the PATH command.
  162.  
  163. Of  course,   having  to  enter  all  of  this  PROMPT  and  PATH
  164. information each time you turn on your PC can become a  nuisance.  The
  165. proper way to handle this is to create special BATch files in the root
  166. directory that store and execute your commands.
  167.  
  168. Creating BATch Files
  169.  
  170. The  most  direct  way  to create .BAT files is to  use  the  DOS ability
  171. to COPY a file directly from the PC keyboard into a  disk file:
  172.  
  173.                            COPY CON filename.BAT
  174.  
  175. where  CON  is  the DOS name for  the  keyboard,  and  "filename"
  176. represents  the name you wish to give your new BATch  file.   You enter
  177. your  file  contents,  line by line,  ending with  a  line containing ^Z
  178. (Control-Z),  which can be entered by pressing  the Function Key 6 (F6).
  179. As an alternative (though I don't recommend it)  you could learn to use
  180. EDLIN,  a minimal file editor,  whose chief  virtue  is its automatic
  181. inclusion with the  DOS  package.  For  serious  work of this kind,  a good
  182. file editor is  a  great help.  The IBM Personal Editor is one of the very
  183. best.
  184.  
  185. The AUTOEXEC and SETPATH BATch Files
  186.  
  187. The  AUTOEXEC.BAT  file is executed only at startup  (unless  you
  188. specifically enter it),  and contains those commands you wish  to enter for
  189. your convenience in operating your PC.
  190.  
  191. A simple version of an AUTOEXEC.BAT file might look like this:
  192.  
  193. DATE
  194. TIME
  195. PROMPT $P$G
  196. PATH C:\anyname1;C:\anyname2;C:\any3
  197.  
  198. The  first  thing you may want to do is to move the PATH  command from  the
  199. AUTOEXEC.BAT  file and put it in its  own  BATch  file called SETPATH.BAT.
  200. The AUTOEXEC.BAT would have these four lines:
  201.  
  202. DATE
  203. TIME
  204. PROMPT $P$G
  205. SETPATH
  206.  
  207. Your SETPATH.BAT file would look like this:
  208.  
  209. PATH C:\anyname1;C:\anyname2;C:\any3
  210.  
  211. Putting the PATH command in the SETPATH.BAT file lets you  modify your
  212. program search path any time you wish,  and then restore it by  getting
  213. into  the root directory and  entering  the  SETPATH command.
  214.  
  215.  
  216.  
  217.                  Taking Advantage of Your PC's Hard Disk:
  218.                  Part III, CONFIG.SYS and the Virtual Disk
  219.  
  220.                                Barry Gordon
  221.                      New York Personal Computer, Inc.
  222.  
  223. There   are  some  simple  things  you  can  do  to  enhance  the
  224. performance of your hard drive.  Creating a CONFIG.SYS file and a virtual
  225. disk  can give you added power and speed in  working  on your PC by
  226. reconfiguring your operating system and Random  Access Memory (RAM).
  227.  
  228. The  CONFIG.SYS File
  229.  
  230. Another  file  that  is  useful  in the  root  directory  is  the
  231. CONFIG.SYS file.   It's a collection of miscellany to modify  the way  the
  232. PC system works.   You may want to try a CONFIG.SYS file consisting of
  233. three lines:
  234.  
  235. BREAK=ON
  236. FILES=16
  237. BUFFERS=8
  238.  
  239. The BREAK command allows you to interrupt the system more  easily should
  240. you wish to terminate the execution of a program.
  241.  
  242. The  FILES command allows DOS to juggle more than the default  of eight
  243. active files simultaneously.   This is important,  because DOS  loads five
  244. files of its own,  leaving you with  only  three.  Sixteen should give you
  245. enough to handle most any situation.
  246.  
  247. The   BUFFERS  command  can  speed  up  certain  kinds  of   disk
  248. operations.  You  may want to try as many as 16 or even 32 for  a 20MB hard
  249. disk.
  250.  
  251. The Virtual Disk
  252.  
  253. A large internal RAM not only allows manipulation of larger files when
  254. necessary,  but  gives  the  user access to  the  speed  of internal
  255. memory  for processing data.   Just as  the  hard  disk increases
  256. computing speed over the diskette drive,  so  internal memory,  if
  257. utilized,  increases  computing speed over the  hard drive.  To  tap the
  258. speed and power of the internal  memory,  you might consider setting up a
  259. virtual disk.  However, to attempt to set up a virtual disk,  you should
  260. have more than 256KB of memory in your PC, preferably, 512KB or larger.
  261.  
  262. The  virtual  disk is a portion of RAM set aside  to  simulate  a disk.
  263. The  virtual disk is referred to by the drive designation letter following
  264. that of the system's last hard disk.  Assuming a single hard disk C:,  our
  265. virtual disk becomes D:.   The  virtual disk is created at startup by a
  266. program such as the VDISK command that  comes  with DOS 3.0.,  working
  267. together with a command  you save in your CONFIG.SYS file.
  268.  
  269. With 512KB of RAM, a reasonable virtual disk size to try is 64KB.  If you
  270. have a 640KB system, you may want to set up a virtual disk of 192KB.  I
  271. suggest leaving about 448KB of available, active RAM to have ample memory
  272. for DOS to do its work.
  273.  
  274. A  virtual  disk of even 64KB can do wonders.   It  can  also  be
  275. effectively  larger  by specifying the smallest  possible  sector size --
  276. e.g., 128 bytes -- for the greatest possible data packing density.
  277. Assuming VDISK.COM and 640KB of RAM,  the virtual disk specification in
  278. your CONFIG.SYS might look like this:
  279.  
  280.            DEVICE=C:\VDISK
  281.  
  282. The entire CONFIG.SYS file would look like this:
  283.  
  284. BREAK=ON
  285. FILES=16
  286. BUFFERS=8
  287. DEVICE=C:\VDISK.SYS 192 128 64
  288.  
  289. The SETPATH.BAT and AUTOEXEC.BAT Files Revised
  290.  
  291. What  do you do with this virtual disk D:  now that it is set up? First,
  292. you  can  begin to take full advantage  of  your  virtual disk's  speed  by
  293. adding a statement to AUTOEXEC.BAT to  transfer the sub-directory of your
  294. most-used files to the virtual disk D:.
  295.  
  296. Your AUTOEXEC.BAT file now contains the following:
  297.  
  298. DATE
  299. TIME
  300. PROMPT $P$G
  301. COPY \anyname1\*.* D:
  302. D:SETPATH
  303.  
  304. Note  that  the SETPATH command must remain the last one  in  the file.
  305. Next,  modify the PATH command (in SETPATH.BAT) to   PATH
  306. D:\;C:\anyname2;C:\any3;C:\any4   replacing the  c:\anyname1  you formerly
  307. had  in  SETPATH.BAT with the root  directory  of  your virtual drive D:\.
  308. (Again, note that you specify complete paths, including  all  drive
  309. designations,  to keep the command  totally independent of what the default
  310. drive might happen to be.)
  311.  
  312. Finally,  move the SETPATH.BAT file out of the root directory and into the
  313. \anyname1 directory for automatic transfer to D:.   This allows  you  to
  314. execute the SETPATH command from  any  directory, entering it as simply
  315. SETPATH or D:SETPATH if necessary.
  316.  
  317. The root directory on your hard drive now contains the  following files:
  318.  
  319. <IBMBIO.COM>
  320. <IBMDOS.COM>
  321. COMMAND.COM
  322. AUTOEXEC.BAT
  323. Sub-directory Names
  324. CONFIG.SYS
  325. VDISK.COM (or equivalent)
  326.  
  327. Tips Concerning The Virtual Drive
  328.  
  329. Now  that your PC has the virtual disk D:,  you will want to keep only your
  330. most-used files in your C:\anyname1 directory.  I would suggest you put in
  331. some DOS external command files, plus regulars like BASIC.COM, or perhaps a
  332. few of your personal favorites, such as PE.EXE or your word processing
  333. program.  Depending on the size of  your  virtual  disk,  you might even
  334. wish to  add  some  non- executable, but nonetheless frequently used, files
  335. that you would like to have accessible from any sub-directory.
  336.  
  337. All  of  these  would  presumably  reside  permanently  in   your
  338. C:\anyname1  directory so that they transfer automatically to  D: at
  339. system  startup.   The one thing you must not forget is  that your  virtual
  340. disk D:  actually resides in RAM and not on a  real disk drive.   I suggest
  341. you do not store anything in your virtual drive  that  is not stored in a
  342. file on your hard disk  or  on  a diskette,  because  whenever you turn
  343. your PC off or whenever the power fails, everything in your virtual disk is
  344. cleared.
  345.  
  346. Summary
  347.  
  348. That's  it.   My  experience shows that a hard  disk  with  large internal
  349. RAM,  set up more or less as recommended here,  can be a real  pleasure to
  350. operate.   A brief summary of what the  various files might look like is
  351. given below:
  352.  
  353. The Root Directory
  354.  
  355.      <IBMBIO.COM>
  356.      <IBMDOS.COM>
  357.      COMMAND.COM
  358.      AUTOEXEC.BAT
  359.      Sub-directory Names
  360.      CONFIG.SYS
  361.      VDISK.COM    (or equivalent)
  362.  
  363. CONFIG.SYS File
  364.  
  365.      BREAK=ON
  366.      FILES=16
  367.      BUFFERS=8
  368.      DEVICE=C:\VDISK.SYS 192 128 64
  369.  
  370. The numercial values in the DEVICE command will vary depending on the size
  371. you wish your virtual disk to be.
  372.  
  373. AUTOEXEC.BAT File
  374.  
  375.      DATE
  376.      TIME
  377.      COPY  C:\anyname 1\*.* D:
  378.      PROMPT $P$G
  379.      D:SETPATH
  380.  
  381. The  D:  shown  above presumes that you don't have a second  hard disk
  382. attached to your PC.   With two hard disks, the virtual disk would be E:.
  383.  
  384. C:\anyname1 (Directory)
  385.  
  386. SETPATH.BAT
  387. Most Frequently used Executable Files
  388. High Usage Reference/Data Files
  389.  
  390. SETPATH.BAT File
  391.  
  392. PATH D:\;C:\any1;C:\any2\;C:any3;...
  393.  
  394. C:\anyname 2   et al  (Directories)
  395.  
  396. Other Executable Files by Frequency of Use
  397. Other Data Files Grouped by Related Functions
  398.  
  399.